<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">

<head>

	<meta charset="utf-8" />
	<meta name="viewport" content="width=device-width, initial-scale=1.0" />
	<title>仓储管理|权限列表</title>
	<link th:href="@{/css/bootstrap.min.css}" rel="stylesheet" />
	<link th:href="@{/font-awesome/css/font-awesome.css}" rel="stylesheet" />
	<link th:href="@{/css/style.css}" rel="stylesheet" />

	<link th:href="@{/css/plugins/iCheck/custom.css}" rel="stylesheet"/>
	<link th:href="@{/css/plugins/footable/footable.core.css}" rel="stylesheet"/>

</head>

<body>

<div id="wrapper">
	<nav class="navbar-default navbar-static-side" role="navigation" th:include="nav :: navigation"></nav>
	<div id="page-wrapper" class="gray-bg">
		<div class="border-bottom" th:include="header :: headerTop"></div>
		<div class="wrapper wrapper-content animated fadeInRight">
			<div class="row">
				<!--这是原来的权限管理的部分-->
				<div class="col-lg-12">
					<div class="ibox float-e-margins">
						<div class="ibox-title">
							<h5>权限管理</h5>
							<div class="ibox-tools">
								<a class="collapse-link">
									<i class="fa fa-chevron-up"></i>
								</a>
							</div>
						</div>
						<div class="ibox-content" style="display: block;">
							<form action="authorityManage_0_0_0">
								<div class="row">
									<div class="col-sm-1 m-b-xs">
										<a href="#" th:onclick="'javascript:authorityEdit('+${authority.id}+');'" class="btn btn-primary btn-sm" data-toggle="tooltip" data-placement="left" title="" data-original-title="Refresh inbox"><i class="fa fa-plus"></i>新增权限</a>
									</div>
									<div class="col-sm-2 m-b-xs">
										<input id="name" name="name" value="" th:value="${authority.name}" placeholder="权限名" class="form-control" type="text"/>
									</div>
									<div class="col-sm-1 m-b-xs">
										<button id="submitButton" class="btn btn-primary btn-block" type="submit"><i class="fa fa-search"></i>&nbsp;&nbsp;&nbsp;&nbsp;<strong>搜索</strong></button>
									</div>

									<div class="col-sm-1 m-b-xs">
										<a href="#" onclick="doClear()" class="btn btn-primary btn-block" data-toggle="tooltip" data-placement="left" title="" data-original-title="Refresh inbox"><i class="fa fa-refresh"></i>&nbsp;&nbsp;清空</a>
									</div>
								</div>
							</form>
						</div>
					</div>
				</div>
				<!--这是原来的权限列表的部分-->
				<div class="col-lg-12">
					<div class="ibox float-e-margins">
						<div class="ibox-title">
							<h5>权限列表</h5>
							<div class="ibox-tools">
								<a class="collapse-link">
									<i class="fa fa-chevron-up"></i>
								</a>
							</div>
						</div>
						<div class="ibox-content">

							<div class="table-responsive">
								<table class=" table table-striped" data-page-size="10">
									<thead>
									<tr>
										<th width="5%">序号</th>
										<th width="10%">权限名</th>
										<th width="10%">父节点</th>
										<th width="10%">排序号</th>
										<th width="20%">URL</th>
										<th width="10%">图标</th>
										<th>操作</th>
									</tr>
									</thead>
									<tbody>
									<tr th:each="authority : ${list}">
										<td th:text="${authority.dataIndex}">Onions</td>
										<td th:text="${authority.name}">Onions</td>
										<td th:text="${authority.parentName}">Onions</td>
										<td th:text="${authority.sortNumber}">Onions</td>
										<td th:text="${authority.url}">Onions</td>
										<td th:text="${authority.icon}">Onions</td>
										<td>
											<a href="#" th:onclick="'javascript:authorityEdit('+${authority.id}+');'" title="修改"><i class="fa fa-edit text-navy">修改</i></a>
											&nbsp;&nbsp;&nbsp;&nbsp;
											<a href="#" th:onclick="'javascript:authorityDelete('+${authority.id}+');'" title="删除"><i class="fa fa-trash-o text-danger">删除</i></a>
										</td>
									</tr>
									</tbody>
									<tfoot>
									<tr>
										<td colspan="7">
											<ul id="pageHTML" class="pagination pull-right"></ul>
										</td>
									</tr>
									</tfoot>
								</table>
								<form id="authorityForm" action="authorityEditGetEntity" method="POST" class="form-horizontal" enctype="multipart/form-data">
									<input type="hidden" id="id" name="id" />
								</form>
							</div>
						</div>
					</div>
				</div>

				<!--<div class="col-lg-6">
            <div class="ibox float-e-margins">
                <div class="ibox-title">
                    <h5>权限管理</h5>
                    <div class="ibox-tools">
                        <a class="collapse-link">
                            <i class="fa fa-chevron-up"></i>
                        </a>
                    </div>
                </div>
                <div class="ibox-content" style="display: block;">
                    <form action="authorityManage_0_0_0">
                        <div class="row">
                            <div class="col-sm-3 m-b-xs">
                                <a href="#" th:onclick="'javascript:authorityEdit('+${authority.id}+');'" class="btn btn-primary btn-sm" data-toggle="tooltip" data-placement="left" title="" data-original-title="Refresh inbox"><i class="fa fa-plus"></i>新增权限</a>
                            </div>
                            <div class="col-sm-3 m-b-xs">
                                <input id="name" name="name" value="" th:value="${authority.name}" placeholder="权限名" class="form-control" type="text"/>
                            </div>
                            <div class="col-sm-3 m-b-xs">
                                <button id="submitButton" class="btn btn-primary btn-block" type="submit"><i class="fa fa-search"></i>&nbsp;&nbsp;&nbsp;&nbsp;<strong>搜索</strong></button>
                            </div>

                            <div class="col-sm-3 m-b-xs">
                                <a href="#" onclick="doClear()" class="btn btn-primary btn-block" data-toggle="tooltip" data-placement="left" title="" data-original-title="Refresh inbox"><i class="fa fa-refresh"></i>&nbsp;&nbsp;清空</a>
                            </div>
                        </div>
                    </form>
                </div>
            </div>
        </div>
            <div class="col-lg-6">
                <div class="ibox float-e-margins">
                    <div class="ibox-title">
                        <h5>权限管理</h5>
                        <div class="ibox-tools">
                            <a class="collapse-link">
                                <i class="fa fa-chevron-up"></i>
                            </a>
                        </div>
                    </div>
                    <div class="ibox-content" style="display: block;">
                        <form action="authorityManage_0_0_0">
                            <div class="row">
                                <div class="col-sm-3 m-b-xs">
                                    <a href="#" th:onclick="'javascript:authorityEdit('+${authority.id}+');'" class="btn btn-primary btn-sm" data-toggle="tooltip" data-placement="left" title="" data-original-title="Refresh inbox"><i class="fa fa-plus"></i>新增权限</a>
                                </div>
                                <div class="col-sm-3 m-b-xs">
                                    <input id="name" name="name" value="" th:value="${authority.name}" placeholder="权限名" class="form-control" type="text"/>
                                </div>
                                <div class="col-sm-3 m-b-xs">
                                    <button id="submitButton" class="btn btn-primary btn-block" type="submit"><i class="fa fa-search"></i>&nbsp;&nbsp;&nbsp;&nbsp;<strong>搜索</strong></button>
                                </div>

                                <div class="col-sm-3 m-b-xs">
                                    <a href="#" onclick="doClear()" class="btn btn-primary btn-block" data-toggle="tooltip" data-placement="left" title="" data-original-title="Refresh inbox"><i class="fa fa-refresh"></i>&nbsp;&nbsp;清空</a>
                                </div>
                            </div>
                        </form>
                    </div>
                </div>
            </div>
				<div class="col-lg-6">
					<div class="ibox float-e-margins">
						<div class="ibox-title">
							<h5>权限管理</h5>
							<div class="ibox-tools">
								<a class="collapse-link">
									<i class="fa fa-chevron-up"></i>
								</a>
							</div>
						</div>
						<div class="ibox-content" style="display: block;">
							<form action="authorityManage_0_0_0">
								<div class="row">
									<div class="col-sm-1 m-b-xs">
										<a href="#" th:onclick="'javascript:authorityEdit('+${authority.id}+');'" class="btn btn-primary btn-sm" data-toggle="tooltip" data-placement="left" title="" data-original-title="Refresh inbox"><i class="fa fa-plus"></i>新增权限</a>
									</div>
									<div class="col-sm-2 m-b-xs">
										<input id="name" name="name" value="" th:value="${authority.name}" placeholder="权限名" class="form-control" type="text"/>
									</div>
									<div class="col-sm-1 m-b-xs">
										<button id="submitButton" class="btn btn-primary btn-block" type="submit"><i class="fa fa-search"></i>&nbsp;&nbsp;&nbsp;&nbsp;<strong>搜索</strong></button>
									</div>

									<div class="col-sm-1 m-b-xs">
										<a href="#" onclick="doClear()" class="btn btn-primary btn-block" data-toggle="tooltip" data-placement="left" title="" data-original-title="Refresh inbox"><i class="fa fa-refresh"></i>&nbsp;&nbsp;清空</a>
									</div>
								</div>
							</form>
						</div>
					</div>
				</div>
				<div class="col-lg-12">
					<div class="col-lg-6">
						<div class="ibox float-e-margins">
							<div class="ibox-title">
								<h5>权限列表</h5>
								<div class="ibox-tools">
									<a class="collapse-link">
										<i class="fa fa-chevron-up"></i>
									</a>
								</div>
							</div>
							<div class="ibox-content">

								<div class="table-responsive">
									<table class=" table table-striped" data-page-size="10">
										<thead>
										<tr>
											<th width="5%">序号</th>
											<th width="10%">权限名</th>
											<th width="10%">父节点</th>
											<th width="10%">排序号</th>
											<th width="20%">URL</th>
											<th width="10%">图标</th>
											<th>操作</th>
										</tr>
										</thead>
										<tbody>
										<tr th:each="authority : ${list}">
											<td th:text="${authority.dataIndex}">Onions</td>
											<td th:text="${authority.name}">Onions</td>
											<td th:text="${authority.parentName}">Onions</td>
											<td th:text="${authority.sortNumber}">Onions</td>
											<td th:text="${authority.url}">Onions</td>
											<td th:text="${authority.icon}">Onions</td>
											<td>
												<a href="#" th:onclick="'javascript:authorityEdit('+${authority.id}+');'" title="修改"><i class="fa fa-edit text-navy">修改</i></a>
												&nbsp;&nbsp;&nbsp;&nbsp;
												<a href="#" th:onclick="'javascript:authorityDelete('+${authority.id}+');'" title="删除"><i class="fa fa-trash-o text-danger">删除</i></a>
											</td>
										</tr>
										</tbody>
										<tfoot>
										<tr>
											<td colspan="7">
												<ul id="pageHTML" class="pagination pull-right"></ul>
											</td>
										</tr>
										</tfoot>
									</table>
									<form id="authorityForm" action="authorityEditGetEntity" method="POST" class="form-horizontal" enctype="multipart/form-data">
										<input type="hidden" id="id" name="id" />
									</form>
								</div>
							</div>
						</div>
					</div>
					<div class="col-lg-6">
						<div class="ibox float-e-margins">
							<div class="ibox-title">
								<h5>权限列表</h5>
								<div class="ibox-tools">
									<a class="collapse-link">
										<i class="fa fa-chevron-up"></i>
									</a>
								</div>
							</div>
							<div class="ibox-content">

								<div class="table-responsive">
									<table class=" table table-striped" data-page-size="10">
										<thead>
										<tr>
											<th width="5%">序号</th>
											<th width="10%">权限名</th>
											<th width="10%">父节点</th>
											<th width="10%">排序号</th>
											<th width="20%">URL</th>
											<th width="10%">图标</th>
											<th>操作</th>
										</tr>
										</thead>
										<tbody>
										<tr th:each="authority : ${list}">
											<td th:text="${authority.dataIndex}">Onions</td>
											<td th:text="${authority.name}">Onions</td>
											<td th:text="${authority.parentName}">Onions</td>
											<td th:text="${authority.sortNumber}">Onions</td>
											<td th:text="${authority.url}">Onions</td>
											<td th:text="${authority.icon}">Onions</td>
											<td>
												<a href="#" th:onclick="'javascript:authorityEdit('+${authority.id}+');'" title="修改"><i class="fa fa-edit text-navy">修改</i></a>
												&nbsp;&nbsp;&nbsp;&nbsp;
												<a href="#" th:onclick="'javascript:authorityDelete('+${authority.id}+');'" title="删除"><i class="fa fa-trash-o text-danger">删除</i></a>
											</td>
										</tr>
										</tbody>
										<tfoot>
										<tr>
											<td colspan="7">
												<ul id="pageHTML" class="pagination pull-right"></ul>
											</td>
										</tr>
										</tfoot>
									</table>
									<form id="authorityForm" action="authorityEditGetEntity" method="POST" class="form-horizontal" enctype="multipart/form-data">
										<input type="hidden" id="id" name="id" />
									</form>
								</div>
							</div>
						</div>
					</div>
				</div>-->

			</div>
		</div>
		<div class="footer" th:include="footer :: copyright"></div>
	</div>
</div>

<!-- Mainly scripts -->
<script th:src="@{/js/jquery-2.1.1.js}"></script>
<script th:src="@{/js/bootstrap.min.js}"></script>
<script th:src="@{/js/plugins/metisMenu/jquery.metisMenu.js}"></script>
<script th:src="@{/js/plugins/slimscroll/jquery.slimscroll.min.js}"></script>

<!-- Peity -->
<script th:src="@{/js/plugins/peity/jquery.peity.min.js}"></script>

<!-- Custom and plugin javascript -->
<script th:src="@{/js/inspinia.js}"></script>
<script th:src="@{/js/plugins/pace/pace.min.js}"></script>

<!-- iCheck -->
<script th:src="@{/js/plugins/iCheck/icheck.min.js}"></script>

<!-- Peity -->
<script th:src="@{/js/demo/peity-demo.js}"></script>

<!-- FooTable -->
<script th:src="@{/js/plugins/footable/footable.all.min.js}"></script>

<!-- common -->
<script th:src="@{/js/common.js}"></script>

<script th:inline="javascript">
    /*<![CDATA[*/

    var pageHTML = [[${pageHTML}]];
    $(document).ready(function () {
        $("#pageHTML").html(pageHTML);

    });
    function doClear(){
        $("#name").val('');
    }
    function authorityEdit(id){
        $("#id").val(id);
        $("#authorityForm").submit();
    }
    function authorityDelete(id){
        if(confirm("确定删除此权限?")){
            $.ajax({
                type: "POST",
                url: "authorityDelete?id="+id,
                contentType: "application/json; charset=utf-8",
                success: function(msg){
                    window.location.reload();
                },
                error: function(){
                    alert("系统异常！");
                }
            });
        }
    }
</script>
</body>

</html>
